<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DM-CtrlH7-BF-DevProgram: C:/Users/ASUS/Desktop/dm-ctrlH7-balance-9025test/bsp/dwt/bsp_dwt.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="50x5.png"/></td>
  <td id="projectalign">
   <div id="projectname">DM-CtrlH7-BF-DevProgram<span id="projectnumber">&#160;beta 0.1</span>
   </div>
   <div id="projectbrief">C.ONE Studio Damiao Development Board Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('bsp__dwt_8c.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">bsp_dwt.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="bsp__dwt_8h_source.html">bsp_dwt.h</a>&quot;</code><br />
<code>#include &quot;cmsis_os.h&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a80bda377ca5cef73b03e7211b1fa18b9" id="r_a80bda377ca5cef73b03e7211b1fa18b9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a80bda377ca5cef73b03e7211b1fa18b9">DWT_Init</a> (uint32_t CPU_Freq_mHz)</td></tr>
<tr class="memdesc:a80bda377ca5cef73b03e7211b1fa18b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化DWT,传入参数为CPU频率,单位MHz  <br /></td></tr>
<tr class="memitem:af3972f1a5023286afdabf8e79abc5ed7" id="r_af3972f1a5023286afdabf8e79abc5ed7"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af3972f1a5023286afdabf8e79abc5ed7">DWT_GetDeltaT</a> (uint32_t *cnt_last)</td></tr>
<tr class="memdesc:af3972f1a5023286afdabf8e79abc5ed7"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取两次调用之间的时间间隔,单位为秒/s  <br /></td></tr>
<tr class="memitem:ae3519a5f8a00524b8ced263a18fbc37e" id="r_ae3519a5f8a00524b8ced263a18fbc37e"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae3519a5f8a00524b8ced263a18fbc37e">DWT_GetDeltaT64</a> (uint32_t *cnt_last)</td></tr>
<tr class="memdesc:ae3519a5f8a00524b8ced263a18fbc37e"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取两次调用之间的时间间隔,单位为秒/s,高精度  <br /></td></tr>
<tr class="memitem:a0f591d032752c63e190dc3d55ea959c7" id="r_a0f591d032752c63e190dc3d55ea959c7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0f591d032752c63e190dc3d55ea959c7">DWT_SysTimeUpdate</a> (void)</td></tr>
<tr class="memdesc:a0f591d032752c63e190dc3d55ea959c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">DWT更新时间轴函数,会被三个timeline函数调用  <br /></td></tr>
<tr class="memitem:ab100be84fd91e5f606bd34b2cd62ecef" id="r_ab100be84fd91e5f606bd34b2cd62ecef"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab100be84fd91e5f606bd34b2cd62ecef">DWT_GetTimeline_s</a> (void)</td></tr>
<tr class="memdesc:ab100be84fd91e5f606bd34b2cd62ecef"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前时间,单位为秒/s,即初始化后的时间  <br /></td></tr>
<tr class="memitem:aff20f0eb6b9b6e4df5c8e509b0ca06dd" id="r_aff20f0eb6b9b6e4df5c8e509b0ca06dd"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aff20f0eb6b9b6e4df5c8e509b0ca06dd">DWT_GetTimeline_ms</a> (void)</td></tr>
<tr class="memdesc:aff20f0eb6b9b6e4df5c8e509b0ca06dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前时间,单位为毫秒/ms,即初始化后的时间  <br /></td></tr>
<tr class="memitem:abf89a827c23ac1dcbb5639369d658081" id="r_abf89a827c23ac1dcbb5639369d658081"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abf89a827c23ac1dcbb5639369d658081">DWT_GetTimeline_us</a> (void)</td></tr>
<tr class="memdesc:abf89a827c23ac1dcbb5639369d658081"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取当前时间,单位为微秒/us,即初始化后的时间  <br /></td></tr>
<tr class="memitem:a88912548ae8934bfc08e9c340974cab9" id="r_a88912548ae8934bfc08e9c340974cab9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a88912548ae8934bfc08e9c340974cab9">DWT_Delay</a> (float Delay)</td></tr>
<tr class="memdesc:a88912548ae8934bfc08e9c340974cab9"><td class="mdescLeft">&#160;</td><td class="mdescRight">DWT延时函数,单位为秒/s.  <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>Wang Hongxi </dd>
<dd>
modified by Neo with annotation </dd></dl>
<dl class="section version"><dt>Version</dt><dd>V1.1.0 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2022/3/8 </dd></dl>
</div><a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
<a id="a88912548ae8934bfc08e9c340974cab9" name="a88912548ae8934bfc08e9c340974cab9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a88912548ae8934bfc08e9c340974cab9">&#9670;&#160;</a></span>DWT_Delay()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DWT_Delay </td>
          <td>(</td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>Delay</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>DWT延时函数,单位为秒/s. </p>
<dl class="section attention"><dt>Attention</dt><dd>该函数不受中断是否开启的影响,可以在临界区和关闭中断时使用 </dd></dl>
<dl class="section note"><dt>Note</dt><dd>禁止在__disable_irq()和__enable_irq()之间使用HAL_Delay()函数,应使用本函数</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Delay</td><td>延时时间,单位为秒/s </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="af3972f1a5023286afdabf8e79abc5ed7" name="af3972f1a5023286afdabf8e79abc5ed7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3972f1a5023286afdabf8e79abc5ed7">&#9670;&#160;</a></span>DWT_GetDeltaT()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float DWT_GetDeltaT </td>
          <td>(</td>
          <td class="paramtype">uint32_t *</td>          <td class="paramname"><span class="paramname"><em>cnt_last</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取两次调用之间的时间间隔,单位为秒/s </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cnt_last</td><td>上一次调用的时间戳 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>float 时间间隔,单位为秒/s </dd></dl>

</div>
</div>
<a id="ae3519a5f8a00524b8ced263a18fbc37e" name="ae3519a5f8a00524b8ced263a18fbc37e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3519a5f8a00524b8ced263a18fbc37e">&#9670;&#160;</a></span>DWT_GetDeltaT64()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double DWT_GetDeltaT64 </td>
          <td>(</td>
          <td class="paramtype">uint32_t *</td>          <td class="paramname"><span class="paramname"><em>cnt_last</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取两次调用之间的时间间隔,单位为秒/s,高精度 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cnt_last</td><td>上一次调用的时间戳 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>double 时间间隔,单位为秒/s </dd></dl>

</div>
</div>
<a id="aff20f0eb6b9b6e4df5c8e509b0ca06dd" name="aff20f0eb6b9b6e4df5c8e509b0ca06dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff20f0eb6b9b6e4df5c8e509b0ca06dd">&#9670;&#160;</a></span>DWT_GetTimeline_ms()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float DWT_GetTimeline_ms </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取当前时间,单位为毫秒/ms,即初始化后的时间 </p>
<dl class="section return"><dt>Returns</dt><dd>float </dd></dl>

</div>
</div>
<a id="ab100be84fd91e5f606bd34b2cd62ecef" name="ab100be84fd91e5f606bd34b2cd62ecef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab100be84fd91e5f606bd34b2cd62ecef">&#9670;&#160;</a></span>DWT_GetTimeline_s()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">float DWT_GetTimeline_s </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取当前时间,单位为秒/s,即初始化后的时间 </p>
<dl class="section return"><dt>Returns</dt><dd>float 时间轴 </dd></dl>

</div>
</div>
<a id="abf89a827c23ac1dcbb5639369d658081" name="abf89a827c23ac1dcbb5639369d658081"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf89a827c23ac1dcbb5639369d658081">&#9670;&#160;</a></span>DWT_GetTimeline_us()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint64_t DWT_GetTimeline_us </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取当前时间,单位为微秒/us,即初始化后的时间 </p>
<dl class="section return"><dt>Returns</dt><dd>uint64_t </dd></dl>

</div>
</div>
<a id="a80bda377ca5cef73b03e7211b1fa18b9" name="a80bda377ca5cef73b03e7211b1fa18b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a80bda377ca5cef73b03e7211b1fa18b9">&#9670;&#160;</a></span>DWT_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DWT_Init </td>
          <td>(</td>
          <td class="paramtype">uint32_t</td>          <td class="paramname"><span class="paramname"><em>CPU_Freq_mHz</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化DWT,传入参数为CPU频率,单位MHz </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CPU_Freq_mHz</td><td>c板为168MHz,A板为180MHz </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0f591d032752c63e190dc3d55ea959c7" name="a0f591d032752c63e190dc3d55ea959c7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f591d032752c63e190dc3d55ea959c7">&#9670;&#160;</a></span>DWT_SysTimeUpdate()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DWT_SysTimeUpdate </td>
          <td>(</td>
          <td class="paramtype">void</td>          <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>DWT更新时间轴函数,会被三个timeline函数调用 </p>
<dl class="section attention"><dt>Attention</dt><dd>如果长时间不调用timeline函数,则需要手动调用该函数更新时间轴,否则CYCCNT溢出后定时和时间轴不准确 </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a href="dir_3c5459f7c179b79c90e2565474bb2856.html">bsp</a></li><li class="navelem"><a href="dir_fea582d6a6afdf428a0401dd23e754f9.html">dwt</a></li><li class="navelem"><a href="bsp__dwt_8c.html">bsp_dwt.c</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>
